package controllers

import "github.com/gin-gonic/gin"

type Context struct {
	*gin.Context
}

type Response struct {
	ErrCode int         `json:"errcode"`
	Errmsg  string      `json:"errmsg"`
	Data    interface{} `json:"data"`
}

func (c Context) Response(data interface{}) {
	c.JSON(200, Response{
		ErrCode: 0,
		Errmsg:  "",
		Data:    data,
	})
}
